package net.oschina.app.previousTest;

import android.test.ActivityInstrumentationTestCase2;
import android.view.View;

import com.robotium.solo.Solo;

import net.oschina.app.AppStart;

/**
 * Created by Administrator on 2017/6/30.
 */

public class IDTest extends ActivityInstrumentationTestCase2 {

    private Solo solo;

    public IDTest() {
        super(AppStart.class);
    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        solo = new Solo(getInstrumentation(), getActivity());
    }

    public void testName() throws Exception {
        //用ID定位 发现
        View view = solo.getView("net.oschina.app:id/nav_item_explore");
        //对控件 进行点击
        solo.clickOnView(view);
        solo.sleep(3000);
        //用ID定位 综合
        View view1 = solo.getView("net.oschina.app:id/nav_item_news");
        solo.clickOnView(view1);
        solo.sleep(3000);
    }

    @Override
    public void tearDown() throws Exception {
        solo.finishOpenedActivities();
        super.tearDown();
    }
}
